package com.lysj.merchant.desk.controller;

import com.lysj.admin.utils.spring.foundation.base.BaseController;
import com.lysj.admin.utils.web.ParamUtil;
import com.lysj.admin.utils.web.Resp;
import com.lysj.merchant.desk.domain.DeskRoom;
import com.lysj.merchant.desk.service.DeskRoomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Created by drj on 2019-03-07 14:36:13
 * @description 餐桌位置控制层
 */
@Slf4j
@RestController
@RequestMapping("/merchant/desk_room")
public class DeskRoomController extends BaseController<DeskRoom> {

    @Resource
    private DeskRoomService deskRoomService;

    @Override
    public DeskRoomService getService() {
        return deskRoomService;
    }


    @Override
    public Resp save(DeskRoom entity) {
        if (ParamUtil.isBlank(entity.getName())) {
            return new Resp().error(Resp.Status.PARAM_ERROR, "名称不能为空");
        }
        return super.save(entity);
    }
}
